package MainTest;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.text.SimpleDateFormat;

/**
 * @TODO Created by xuyi on 2016/8/25.
 */
public class testFileIn {


    public static void main(String[] args) {


        try {
            File file = new File("C:\\Users\\xuyix\\Desktop\\t");

            FileInputStream fis = null;

            byte[] buff = new byte[1024 * 1024 * 10];

            int len = 0;

            File[] files = file.listFiles();

            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh-mm-ss.sss");
            System.out.println(simpleDateFormat.format(System.currentTimeMillis()));
            for (int i = 0; i < files.length; i++) {

                if (!files[i].isDirectory()) {
                    fis = new FileInputStream(files[i]);

                    while ((fis.read(buff)) != -1) {

                        fis.read(buff, 0, len);

                    }
                }
            }
            System.out.println(simpleDateFormat.format(System.currentTimeMillis()));
            System.out.println(buff.length);
            fis.close();
        } catch (Exception e) {
            e.printStackTrace();
        }


    }


}
